package org.ym.file.domain.model.files.embed;

import lombok.*;
import org.ym.file.domain.common.enums.FileStoreType;
import org.ym.file.domain.common.enums.FileStoreTypeConverter;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * @author ym
 */
@Embeddable
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@EqualsAndHashCode
@ToString
public class FileStoreInfo implements Serializable {

    private static final long serialVersionUID = 5400025917497351514L;
    /**
     * 文件节点
     */
    @Column(name = "node_id")
    private Long fileSystemNodeId;
    /**
     * 存储位置
     */
    @Column(name = "store_path",length = 300,nullable = false)
    private String storePath;
    /**
     * 存储类型
     */
    @Convert(converter = FileStoreTypeConverter.class)
    @Column(name = "file_store_type",nullable = false)
    private FileStoreType fileStoreType;
    /**
     * 盐
     */
    @Column(name = "salt",length = 64)
    private String salt;
}
